package org.example.cloudapply.service.impl;


import org.example.cloudapply.entity.Admin;
import org.example.cloudapply.repository.AdminRepository;
import org.example.cloudapply.service.AdminService;
import org.example.cloudapply.utils.Md5Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Map;

@Service
public class AdminServicelmpl implements AdminService {
    @Autowired
    private AdminRepository adminRepository;

    public Admin findByUserName(String username) {
        Admin u=adminRepository.findByUserName(username);
        return  u;
    }
    public void register(String username, String password) {
        String md5string = Md5Util.getMD5String(password);
        adminRepository.add(username,md5string);
    }
}
